import $request from '../../../request/index'
import {formatRequestDataToJSON} from '../../../utils/api';
export const workflowRequest = async ({
  managerMethod,
  params,
}) => {
  const args = `managerMethod=${managerMethod}&arguments=${formatRequestDataToJSON([...params])}`;
  const [success, error] = await $request({
    url: `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=WFAjax&rnd=97448`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: args
  })
  if(success === null || error) return false
  return success
}
